#include <stdio.h>

int main(int argc, char *argv[])
{
	int n, i;
	scanf("%d", &n);

	n = n - 1;
	i = 0;
	while (n - i > 0) {
		n = n - i;
		i++;
	}
	printf("%d\n", i);

	return 0;
}
